//
//  UIViewController+LSCore.m
//  zeekol
//
//  Created by gaojiefeng on 2020/7/17.
//  Copyright © 2020 gaojiefeng. All rights reserved.
//

#import "UIViewController+LSCore.h"

@implementation UIViewController(LSCore)
- (void)setOrientations:(UIInterfaceOrientation)orientation{
    if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) {
        SEL selector  = NSSelectorFromString(@"setOrientation:");
        NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[UIDevice instanceMethodSignatureForSelector:selector]];
        [invocation setSelector:selector];
        [invocation setTarget:[UIDevice currentDevice]];
        [invocation setArgument:&orientation atIndex:2];
        [invocation invoke];
    }
}

@end
